import React from "react";
const Home = (props) => (
  <div>
    <h1>我是Home</h1>
    {/*props.child 接受插槽里的内容 */}
    {props.children /* 等价于vue里的slot标签 */}
    {/* cloneElement */}
    {/* {React.Children.only} */}
    {React.Children.map(props.children, (child) => {
      console.log(child);
      return React.cloneElement(child, { color: "red" });
    })}
  </div>
);
export default Home;
